***load data

use "${path}\data\text\text_ready.dta", clear 

***Online Appendix Tables

cd "${path}\output\tables"

***Table A.XVI

foreach v of varlist ln_evolution_regex ln_motion_regex ln_matter_regex ln_energy_regex ln_reproduction_regex ln_climate_regex ln_pollution_regex ln_earth_regex ln_tectonics_regex ln_universe_regex ln_all_non_evo_regex ln_word_count_raw {
eststo: reg `v' evo_score i.state_code i.year, vce(cluster state_code) baselevels
estadd ysumm
}
esttab using word_count.tex, replace keep(evo_score) b(3) se(3) fragment  nonotes  label /// 
stats(ymean ysd  r2_a N, labels ("Mean of Dep. Var." "Std. Dev. of Dep. Var." "Adj. R-squared" "Observations") fmt(2 2 3 %9.0fc))  /// 
mgroups("Word Count of:" "Counts of the following Non-Evolution Scientific Words:" "\specialcell{Counts of \\ all Words:}", pattern(1 1 0 0 0 0 0 0 0 0 0 1) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) /// 
mlabels("Evolution" "Motion" "\specialcell{Matter \\ and Mass}" "Energy" "Reproduction" "\specialcell{Climate \\ Change}" "Pollution" "Earth" "Tectonics" "Universe" "\specialcell{Sum}" "Sum") star(* 0.1 ** 0.05 *** 0.01) /// 
indicate("State FEs = *state_code" "Year FEs = *year", labels("YES" "NO"))
eststo clear
